<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height">
    <div class="flex-box border-hover-style">
      <div class="Showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomInfo :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <img class="outline-parent-bg" :src="publicUrls + 'free/style17/Level2outlineStyle3.webp'" alt="" />
      <div class="outline">
        <div
          class="outline-content"
          :class="{
            content5: props.info.value && props.info.remarks && props.info.subTitle,
            content4: props.info.value && !props.info.remarks && !props.info.subTitle,
            content3: props.info.value && !props.info.remarks && props.info.subTitle,
            content2: props.info.value && !props.info.remarks && props.info.subTitle,
          }"
        >
          <div class="content-box-right">
            <span class="title"> {{ props.info.text }}</span>
            <img class="title-bg" :src="publicUrls + 'free/style17/Level2outlineStyle3Title.webp'" alt="" />
          </div>

          <p class="outline-subTitle" v-if="props.info.subTitle">
            {{ props.info.subTitle }}
          </p>
          <div class="cover" v-if="props.info.value" :class="!props.info.remarks && 'cover-no'">
            <img
              class="coverImg"
              @click="ImgVisible = true"
              :src="urls + props.info.value + '?imageView2/3/format/webp'"
              alt=""
            />
          </div>
          <div class="remarks1" v-if="props.info.value && props.info.remarks">
            <TextMax
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="3"
            ></TextMax>
          </div>
          <div
            class="remarks2"
            :class="{
              remarks3: !props.info.subTitle,
            }"
            v-else-if="props.info.remarks"
          >
            <TextMax
              :infoData="props.info"
              v-if="props.domShow"
              :data="props.info.remarks"
              :title="props.info.text"
              :row="props.info.subTitle ? 7 : 7"
            ></TextMax>
          </div>
        </div>
      </div>
    </div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'free17Style2',
});
</script>

<script setup lang="ts">
import { publicUrls, textType } from '@/utils/minxin';
import digitalShowroomInfo from '@/freeComponents/unitdigitalShowroom/style17.vue';
import { urls } from '@/utils/request/upload';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { defineComponent, ref } from 'vue';
import { useProjectStore } from '@/store';
const store = useProjectStore();

const ImgVisible = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
  margin-left: 80px;
  margin-right: 90px;
}
.Showroom-parent {
  position: absolute;
  top: 36px;
  left: 98px;
  z-index: 21;
}
.flex-box {
  width: 437px;
  height: 774px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.outline-parent-bg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
}
.outline {
  z-index: 20;
  width: 100%;
  height: 100%;
  padding: 150px 55px 178px 109px;
}
.outline-content {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
}
.content4 {
  .cover {
    height: 264px;
  }
}
.content5 {
  .content-box-right {
    margin-bottom: 10px;
  }
}
.content3 {
  .cover {
    height: 195px;
    margin-bottom: 20px;
  }
}
.content2 {
  .cover {
    height: 195px;
    margin-bottom: 20px;
  }
}
.content-box-right {
  display: flex; 
  justify-content: center;
  position: relative;
  width: 244.5px;
  padding-bottom: 22px;
  margin-bottom: 20px;

  .title {
    width: 216px;
    color: #7f1a10;
    text-align: center;
    font-family: 'SJxingkai-C';
    font-size: 24px;
    line-height: 30px;
  }
  .title-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 244.5px;
    height: 14px;
  }
}

.outline-subTitle {
  width: 100%;
  color: rgba(116, 22, 21, 0.8);
  text-align: center;
  font-family: 'PingFang SC';
  font-size: 18px;
  line-height: 24px;
  text-align: center;
  margin-bottom: 10px;
  opacity: 0.8;
}
.cover {
  display: flex;
  align-items: center;
  width: 100%; 
  height: 195px;
  border: 1px solid #fff;
  background: rgba(255, 255, 255, 0.4);
  box-shadow: 0px 5.3px 8.8px 0px rgba(213, 58, 56, 0.19);
  backdrop-filter: blur(4.4px);
  position: relative;
  margin-bottom: 10px;
  overflow: hidden;
  &:hover img {
    transform: scale(1.2);
  }
  .coverImg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: all 0.3s ease;
  }
}
.remarks1 {
  width: 100%;
}
.remarks2 {
  width: 100%;
}
.remarks3 {
  width: 100%;
}
::v-deep .van-text-ellipsis {
  text-align: justify;
  font-family: PingFang SC !important;
  font-size: 16px !important;
  line-height: 30px !important;
  color: rgba(116, 22, 21, 0.8) !important;
}
::v-deep .van-text-ellipsis__action::before {
  color: rgba(116, 22, 21, 1) !important;
  font-weight: 600 !important;
  font-family: 'PingFangSC';
}
</style>